{include file="public:header"/}

{include file="public:sidemenu"/}
<!-- {include file="public:datetime"/} -->
		<!-- Start right Content here -->
		<div class="content-page">
			<!-- Start content -->
			<div class="content">
				<div class="am-g">

          <button><a href="{:url('jiekou')}">查看</a></button>
					<span>
						<button type="button" class="btn btn-default" data-toggle="modal" data-target="#addmodal" style="float: right;margin-right: 100px;color: #1E90FF">
						<i class="fa fa-plus fa-2x" aria-hidden="true" >添加</i>
						</button></span> 
					
						
        <div class="am-u-sm-12">
          <div class="row">
              <table id="Projects" class="am-table am-table-striped am-table-hover table-main">
                <thead>
                  <tr>
                  	<th>编号</th>
                  <th>项目名称</th>
                    <th>简介</th>
                     <th>上课须知</th>
                      <th>上课地点</th>
                      <th>上课时间</th>
                       <th>项目价格</th>
                       <th>联系电话</th>
                    <th>操作</th>
                  </tr>
                </thead>
                <tbody>
                {volist name="projects" id="vo"}
                  <tr>
                  	<td>{$vo.p_id}</td>
                    <td>{$vo.p_name}</td>
                    <td>{$vo.p_intro}</td>
                    <td>{$vo.p_notic}</td>
                    <td>{$vo.p_address}</td>
                    <td>{$vo.p_time}</td>
                    <td>{$vo.p_price}</td>
                    <td>{$vo.p_tel}</td>
                    <td>
                      <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                          <a href="#" data-toggle="modal" data-target="#editmodal" onclick="jsedit({$vo.p_id})">修改</a>
                          |
                          <a href="{:url('delete',['id'=>$vo.p_id])}">删除</a>
                        </div>
                      </div>

                    </td>
                  </tr>
                  {/volist}
                </tbody>
              </table>
              </div>
            </div> 

<!-- <div class="am-fr">
  <ul class="am-pagination tpl-pagination">
        <li class="am-disabled">上一页</li>
       <li><a href="{:url('page')}">1</a>
             </li>
       <li>下一页</li>
      </ul>
    </div> -->

    <!-- <div class="am-fr">
      <ul class="am-pagination tpl-pagination">
        <li class="am-disabled">上一页</li>
        <li class="am-active"><a href="#">1</a></li>
        <li><a href="#">2</a></li>
        <li><a href="#">3</a></li>
        <li><a href="#">4</a></li>
        <li><a href="#">5</a></li>
        <li>下一页</li>
      </ul>
    </div> -->




<!-- 添加模态框 -->
    <div id="addmodal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-header">
        <h3 id="myModalLabel">添加培训项目</h3>
      </div>
      <div class="modal-body">
        <p>
        <form class="am-form am-text-sm" method="post" action="{:url('add')}" enctype="multipart/form-data">

  <div class="form-group">
    <label  class="col-sm-2 am-form-label" for="p_name" >项目名称</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="p_name" placeholder="项目名称" name="p_name" required>
    </div>
  </div>

<div class="form-group">
    <label  class="col-sm-2 am-form-label" for="p_price" >项目价格</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="p_price" placeholder="项目价格" name="p_price" required>
    </div>
  </div>

  <div class="form-group">
    <label  class="col-sm-2 am-form-label" for="p_tel" >联系电话</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="p_tel" placeholder="联系电话" name="p_tel" required>
    </div>
  </div>

<div class="form-group">
    <label  class="col-sm-2 am-form-label" for="p_address" >上课地址</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="p_address" placeholder="上课地址" name="p_address" required>
    </div>
  </div>

<div class="form-group">
    <label  class="col-sm-2 am-form-label">上课须知</label>
    <div class="col-sm-10">
       <textarea class="form-control" rows="3" name="p_notic" required></textarea>
      </div>
</div>

<div class="form-group">
    <label for="p_time" class="col-sm-2 am-form-label">上课时间</label>
    <div class="col-sm-10">
      <input type="date" id="p_time" placeholder="p_time" name="p_time" required>
      <!-- <span class="add-on"><i class="icon-th"></i></span> -->
    </div>
  </div>

<div class="form-group">
    <label  class="col-sm-2 am-form-label">项目简介</label>
    <div class="col-sm-10">
       <textarea class="form-control" rows="3" name="p_intro" required></textarea>
      </div>
</div>

  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <input type="submit" class="btn btn-default" value="添加">
     <input type="reset" class="btn btn-default" value="重置">
  </div>
  </div>
</form>       


        </p>
      </div>
      <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
        <button class="btn btn-primary">Save changes</button>
      </div>
    </div>  
</div>
</div>


<!-- 修改模态框 -->
    <div id="editmodal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-header">
        <h3 id="myModalLabel">修改培训项目</h3>
      </div>
      <div class="modal-body">
        <p>
        <form class="am-form am-text-sm" method="post" action="{:url('update')}" enctype="multipart/form-data">
          <input type="hidden" name="p_id" id="pid_edit">

  <div class="form-group">
    <label  class="col-sm-2 am-form-label" for="p_name" >项目名称</label>
    <div>
      <input type="text" class="form-control" id="p_namea" name="p_name" placeholder="项目名称"  required>
    </div>
  </div>

<div class="form-group">
    <label  class="col-sm-2 am-form-label" for="p_price" >项目价格</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="p_pricea" placeholder="项目价格" name="p_price" required>
    </div>
  </div>

  <div class="form-group">
    <label  class="col-sm-2 am-form-label" for="p_tel" >联系电话</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="p_tela" placeholder="联系电话" name="p_tel" required>
    </div>
  </div>

<div class="form-group">
    <label  class="col-sm-2 am-form-label" for="p_address" >上课地址</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="p_addressa" placeholder="上课地址" name="p_address" required>
    </div>
  </div>

  <div class="form-group">
    <label for="p_time" class="col-sm-2 am-form-label">上课时间</label>
    <div class="col-sm-10">
      <input type="date" id="p_timea" placeholder="p_time" name="p_time" required>
      <!-- <span class="add-on"><i class="icon-th"></i></span> -->
    </div>
  </div>

<div class="form-group">
    <label  class="col-sm-2 am-form-label">上课须知</label>
    <div class="col-sm-10">
       <textarea class="form-control" rows="3" id="p_notica" name="p_notic" required></textarea>
      </div>
</div>

<div class="form-group">
    <label  class="col-sm-2 am-form-label">项目简介</label>
    <div class="col-sm-10">
       <textarea class="form-control" rows="3" name="p_intro" id="p_introa" required></textarea>
      </div>
</div>

  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <input type="submit" class="btn btn-default" value="修改">
     <input type="reset" class="btn btn-default" value="重置">
  </div>
  </div>
</form>       


        </p>
      </div>
      <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
        <button class="btn btn-primary">Save changes</button>
      </div>
    </div>  
</div>
</div>






</div><!-- 3 -->
</div><!-- 2 -->
		</div><!-- 1 -->



<!-- <script type="text/javascript">
    $("#form_datetime").datetimepicker({
       
      autoclose: 1,  
        format: "yyyy mm dd - hh:ii",
        autoclose: true,
        todayBtn: true,
        pickerPosition: "bottom-left"
         weekStart: 1,  //时间图从周一开始算起
      startDate:'-0d'，//当前日期以前的禁用
    });
</script>  -->
<script>
      function jsedit(p_id) {
              //根据TID到数据库里把数据查询到显示在表单控件中
              $.getJSON("{:url('edit')}",{"p_id":p_id},
                  function(json) {
                      //alert(json.intro);
                      $("#pid_edit").val(json.p_id);
                      $("#p_ida").val(json.p_id);
                      $("#p_namea").val(json.p_name);
                      $("#p_notica").val(json.p_notic);
                      $("#p_timea").val(json.p_time);
                      $("#p_pricea").val(json.p_price);
                      $("#p_tela").val(json.p_tel);
                      $("#p_introa").val(json.p_intro);
                      $("#p_addressa").val(json.p_address);
                  });
          }
    </script>	


<!--     <script type="text/javascript">  
    $('#datetimepicker').datetimepicker({  
 language:  'zh-CN',  
      autoclose: 1,  
      format:'yyyy:MM:dd hh:ii',  
      weekStart: 1,  //时间图从周一开始算起
      startDate:'-0d'，//当前日期以前的禁用
     endDate:'2019:01:01',  
     startView: 2,  
     minView: 2,  
     todayBtn:1，  
     todayHighlight:1,  
     keyboardNavigation:1,  
     minuteStep:5,  
     showMeridian: 1，  
 forceParse: 0  
    });  
</script>  -->







{include file="public:footer"/}